<?php
class Foo {
    public function __construct(Bar $bar) {
        
    }
}

interface Bar {
    
}
class BarImpl extends Y {
    public function __construct() {
        
    }
}

//Gets the singleton instance of the injector
$injector = PIOC_Injector::get();
//Wire dependencies
$injector->bind("Bar")->to("BarImpl");
//Get a class from the injector with all the dependencies 
//binded for you
$foo = $injector->getInstance("Foo");
?>